package com.isunland.managesystem.ui;

import android.content.Intent;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.LocaleWorkQueryCount;
import com.isunland.managesystem.entity.LocaleWorkQueryCountSub;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/4/8 15:03
 */
public class LocaleWorkQueryCountSubDetailActivity extends SingleFragmentActivity {
  @Override protected Fragment createFragment() {
    LocaleWorkQueryCount itemMain = (LocaleWorkQueryCount) getIntent().getSerializableExtra(
        LocaleWorkQueryCountSubDetailFragment.EXTRA_MAIN_ITEM);
    LocaleWorkQueryCountSub item = (LocaleWorkQueryCountSub) getIntent().getSerializableExtra(
        LocaleWorkQueryCountSubDetailFragment.EXTRA_ITEM);
    int typeCode = getIntent().getIntExtra(LocaleWorkQueryCountSubDetailFragment.EXTRA_TYPE, 0);
    return LocaleWorkQueryCountSubDetailFragment.newInstance(itemMain, item, typeCode);
  }

  public static void newInstance(android.support.v4.app.Fragment fragment,
      BaseVolleyActivity context, int requestCode, LocaleWorkQueryCount itemMain,
      LocaleWorkQueryCountSub item, int typeCode) {
    if (fragment == null || context == null) return;
    Intent i = new Intent(context, LocaleWorkQueryCountSubDetailActivity.class);
    i.putExtra(LocaleWorkQueryCountSubDetailFragment.EXTRA_MAIN_ITEM, itemMain);
    i.putExtra(LocaleWorkQueryCountSubDetailFragment.EXTRA_ITEM, item);
    i.putExtra(LocaleWorkQueryCountSubDetailFragment.EXTRA_TYPE, typeCode);
    fragment.startActivityForResult(i, requestCode);
  }
}
